//
//  selectMemberTableViewCell.m
//  SouthChina
//
//  Created by zorro on 15/7/1.
//  Copyright (c) 2015年 科创. All rights reserved.
//

#import "selectMemberTableViewCell.h"

@implementation selectMemberTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


- (void)setSelectMemberTableViewCell:(Contact*) contact
{
    _contact = contact;

    NSURL *url= [NSURL URLWithString: [_contact.mHEAD_IMG hasPrefix:@"http"]?_contact.mHEAD_IMG:[NSString stringWithFormat:@"%@%@",DE.fileEngineeUrl,_contact.mHEAD_IMG]];
   
    [self.headImage setImageWithURL:url placeholderImage:[UIImage imageNamed:@"empty_photo"]];
    self.headImage.layer.cornerRadius = self.headImage.frame.size.width / 2;
    self.headImage.clipsToBounds = YES;
    
    self.titleLabel.text = [NSString stringWithFormat:@"%@",_contact.mNAME];
    self.detailLabel.text = _contact.mDEPT;
}


- (void)setDataDictCell:(DataDict*) dataDict
{
    _dataDict = dataDict;
      
    _headImgConstraint.constant = 0.01;
    self.titleLabel.text = dataDict.dictdataValue;
    self.detailLabel.enabled = NO;
}

-(void)setContactSelected:(BOOL)isSelected
{
    [self.checkBox setImage:[UIImage imageNamed:isSelected?@"radio_checked":@"radio_unchecked"]];
}

@end
